package com.test;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Spring Boot应用主类
 * 高性能地理空间查询服务的入口点
 */
@SpringBootApplication
@EnableCaching
public class GpsDemoApplication {

    private static final Logger logger = LoggerFactory.getLogger(GpsDemoApplication.class);

    public static void main(String[] args) {
        logger.info("==================================");
        logger.info("高性能地理空间查询服务启动成功");
        logger.info("应用配置文件: application.yml");
        logger.info("==================================");
        // 预加载GadmQuery单例，避免首次请求时的延迟
        try {
            logger.info("开始预加载地理空间数据和索引...");
            GadmQuery.getInstance();
            logger.info("地理空间数据和索引预加载完成");
        } catch (Exception e) {
            logger.error("预加载地理空间数据失败: {}", e.getMessage(), e);
        }
    }
}